<%@ include file="/html/portlet/ext/registration/init.jsp" %>
<%
	String hidd_val = (String) request.getAttribute("hidd_val");
	System.out.println(">>>>>>hidd_val>>>>"+hidd_val);
%>
<c:choose>

<c:when test='<%= Validator.isNotNull(hidd_val) && hidd_val.equals("College") %>'>

<table class="taglib-search-iterator" style="width:100%" cellspacing="0" cellpadding="2">
	<tr class='results-header'>
		<th><liferay-ui:message key="sNo" /></th>
		<th><liferay-ui:message key="Category" /></th>
		<th><liferay-ui:message key="college-name" /></th>
			
		
	</tr>
<%
    long[] groupIds = null;
	groupIds = (long[]) request.getAttribute("Ids");

	System.out.println("groupId size"+groupIds);
	
	if(Validator.isNotNull(groupIds)) {
	for (int i=0; i < groupIds.length; i++) {
	
		System.out.println(groupIds[i]);
		Group group = GroupLocalServiceUtil.getGroup(groupIds[i]);
		String className = ( ( i%2 == 0 ) ? "portlet-section-body results-row" : "portlet-section-body results-row alt"); 
		String classNameHover = className+" hover";
		System.out.println("group name" +group.getName());
%>
	<tr class='<%= className %>'; onmouseout="this.className = '<%=className%>'" onmouseover="this.className = '<%=classNameHover%>'">
		<td><%= i+1 %></td>
		<td>School</td>
		 
		<td><b><a href=" "> <%= group != null ?group.getName():"" %> &raquo;</a></b><br></td>
	</tr>
<%}%>
<%}%>
</table>
</c:when>

<c:when test='<%= Validator.isNotNull(hidd_val) && hidd_val.equals("Student") %>'>

<table class="taglib-search-iterator" style="width:100%" cellspacing="0" cellpadding="2">
	<tr class='results-header'>
		<th><liferay-ui:message key="sNo" /></th>
		<th><liferay-ui:message key="Category" /></th>
		<th><liferay-ui:message key="student-name" /></th>
			
		
	</tr>
<%
    long[] studentIds = null;
	studentIds = (long[]) request.getAttribute("Ids");

	System.out.println("studentIds size"+studentIds);
	
	if(Validator.isNotNull(studentIds)) {
	for (int i=0; i < studentIds.length; i++) {
	
		System.out.println(studentIds[i]);
		CollStudent student = CollStudentLocalServiceUtil.getCollStudent(studentIds[i]);
		String className = ( ( i%2 == 0 ) ? "portlet-section-body results-row" : "portlet-section-body results-row alt"); 
		String classNameHover = className+" hover";
		System.out.println("student name" +student.getFirstName());
%>
	<tr class='<%= className %>'; onmouseout="this.className = '<%=className%>'" onmouseover="this.className = '<%=classNameHover%>'">
		<td><%= i+1 %></td>
		<td>Student</td>
		 
		<td><b><a href=" "> <%= student != null ?student.getFirstName():"" %> &raquo;</a></b><br></td>
	</tr>
<%}%>
<%}%>
</table>
</c:when>

<c:when test='<%= Validator.isNotNull(hidd_val) && hidd_val.equals("Staff") %>'>

<table class="taglib-search-iterator" style="width:100%" cellspacing="0" cellpadding="2">
	<tr class='results-header'>
		<th><liferay-ui:message key="sNo" /></th>
		<th><liferay-ui:message key="Category" /></th>
		<th><liferay-ui:message key="staff-name" /></th>
			
		
	</tr>
<%
    long[] staffIds = null;
	staffIds = (long[]) request.getAttribute("Ids");

	System.out.println("staffIds size"+staffIds);
	
	if(Validator.isNotNull(staffIds)) {
	for (int i=0; i < staffIds.length; i++) {
	
		System.out.println(staffIds[i]);
		Staff staff = StaffLocalServiceUtil.getStaff(staffIds[i]);
		String className = ( ( i%2 == 0 ) ? "portlet-section-body results-row" : "portlet-section-body results-row alt"); 
		String classNameHover = className+" hover";
		System.out.println("Teacher name" +staff.getFirstName());
%>
	<tr class='<%= className %>'; onmouseout="this.className = '<%=className%>'" onmouseover="this.className = '<%=classNameHover%>'">
		<td><%= i+1 %></td>
		<td><liferay-ui:message key="staff" /></td>
		 
		<td><b><a href=" "> <%= staff != null ?staff.getFirstName():"" %> &raquo;</a></b><br></td>
	</tr>
<%}%>
<%}%>
</table>
</c:when>

</c:choose>